//保存token
export const setToken = (key, value) => {
  localStorage.setItem(
    key,
    value === "Storing" ? value : JSON.stringify(value)
  );
};
//获取token
export const getToken = (key) => {
  const res = localStorage.getItem(key);
  try {
    return JSON.parse(res);
  } catch (e) {
    return res;
  }
};
//删除token
export const removeToken = (key) => {
  localStorage.removeItem(key);
};
